package com.server.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.server.entity.DeviceInfo;
import com.server.mapper.DeviceInfoMapper;
import com.server.service.DeviceInfoService;

/**
 * (DeviceInfo)表服务实现类
 *
 * @author wzw
 * @since 2024-07-23 21:56:35
 */
@Service
public class DeviceInfoServiceImpl extends ServiceImpl<DeviceInfoMapper, DeviceInfo> implements DeviceInfoService {

    @Autowired
    DeviceInfoMapper deviceInfoMapper;

    @Override
    public List<DeviceInfo> showAll() {
        QueryWrapper<DeviceInfo> queryWrapper = new QueryWrapper<>();
        queryWrapper.orderByAsc("functions", "stcd");
        return deviceInfoMapper.selectList(queryWrapper);
    }

    @Override
    public List<DeviceInfo> selectByFunctions(String functions) {
        QueryWrapper<DeviceInfo> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("functions", functions);
        return deviceInfoMapper.selectList(queryWrapper);
    }

}
